<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@page import="java.util.*, com.dsj.entity.CustomerEntity" %>
<jsp:useBean id="countTime" class="com.dsj.util.CountTime"/>
<%
    String message = (String) request.getSession().getAttribute("message");
    if (message != null) {
        out.println("<script>alert('" + message + "');</script>");
        request.getSession().removeAttribute("message"); // 清除已显示的提示信息
    }
%>
<%
    if (session.getAttribute("user") == null) {
%>
<table width="300" height="138" border="0" cellpadding="0"
       cellspacing="0" background="<%=request.getContextPath()%>/images/systemImages/fg_left01.jpg" style="background-repeat: no-repeat">
    <tr>
        <td valign="middle">
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td height="5">
                    </td>
                </tr>
            </table>
            <form name="form" method="post" action="<%=request.getContextPath()%>/pages/customer/userLoginResult.jsp"
                  onSubmit="return checkForm(form)">
                <table width="185" border="0" align="center">
                    <tr height="10">
                        <td></td>
                    </tr>
                    <tr>
                        <br>
                        <td width="60" height="25">
                            帐号：
                        </td>
                        <td width="115" height="25">
                            <input name="name" type="text" size="17">
                        </td>
                    </tr>
                    <tr>
                        <td height="35">
                            密码：
                        </td>
                        <td>
                            <input name="password" type="password" size="17">
                        </td>
                    </tr>
                    <tr>
                        <td height="25">
                            <input type="image" class="input1" src="<%=request.getContextPath()%>/images/systemImages/fg-land.gif"
                                   width="51" height="20">
                        </td>
                        <td height="25">
                            <a href="<%=request.getContextPath()%>/pages/customer/userRegister.jsp">注册</a>&nbsp;&nbsp;
                            <a href="<%=request.getContextPath()%>/pages/customer/userPasswordFind1.jsp">找回密码</a>
                        </td>
                    </tr>
                </table>
            </form>
        </td>
    </tr>
</table>
<%
} else {
    CustomerEntity user = (CustomerEntity) session.getAttribute("user");
%>
<table width="300" height="152" border="0" cellpadding="0"
       cellspacing="0" background="<%=request.getContextPath()%>/images/systemImages/fg_left01.jpg" style="background-repeat: no-repeat">
    <tr>
        <td valign="top">
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td height="30">
                        &nbsp;
                    </td>
                </tr>
            </table>

            <table width="200" border="0" align="center">
                <tr>
                    <td width="200" height="25">
                        <%=user.getUserName()%>登录成功
                    </td>
                </tr>
                <tr>
                    <td height="25"><%=countTime.getNowTime()%></td>
                </tr>
                <tr>
                    <td height="25">
                        用户姓名：<%=user.getRealName()%></td>
                </tr>
                <tr>
                    <td height="20" align="right" valign="middle">
                        <a href="<%=request.getContextPath()%>/pages/customer/loginOut.jsp">安全退出</a>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
<%
    }
%>